import Vue from 'vue'
import Router from 'vue-router'
import NotFound from './../components/views/404.vue'
import index from './../components/views/index.vue';

const kan = r => require.ensure([], () => r(require('./../components/views/kan.vue')), 'kan');
const goodsDetail = r => require.ensure([], () => r(require('./../components/views/goodsDetail.vue')), 'goodsDetail');
const kanDetail = r => require.ensure([], () => r(require('./../components/views/kanDetail.vue')), 'kanDetail');
const pay = r => require.ensure([], () => r(require('./../components/views/pay.vue')), 'pay');
const cart = r => require.ensure([], () => r(require('./../components/views/cart.vue')), 'cart');
const payCart = r => require.ensure([], () => r(require('./../components/views/payCart.vue')), 'payCart');
const user = r => require.ensure([], () => r(require('./../components/views/user.vue')), 'user');
const addAddr = r => require.ensure([], () => r(require('./../components/views/addAddr.vue')), 'addAddr');
const addrList = r => require.ensure([], () => r(require('./../components/views/addrList.vue')), 'addrList');
const game = r => require.ensure([], () => r(require('./../components/views/game.vue')), 'game');
const gameExper = r => require.ensure([], () => r(require('./../components/views/gameExper.vue')), 'gameExper');
const paysuccess = r => require.ensure([], () => r(require('./../components/views/paysuccess.vue')), 'paysuccess');
const prizeList = r => require.ensure([], () => r(require('./../components/views/prizeList.vue')), 'prizeList');
const goodsDetailGet = r => require.ensure([], () => r(require('./../components/views/goodsDetailGet.vue')), 'goodsDetailGet');
const orderList = r => require.ensure([], () => r(require('./../components/views/orderList.vue')), 'orderList');
const jfGoods = r => require.ensure([], () => r(require('./../components/views/jfGoods.vue')), 'jfGoods');
const orderSuccess = r => require.ensure([], () => r(require('./../components/views/orderSuccess.vue')), 'orderSuccess');
const kefu = r => require.ensure([], () => r(require('./../components/views/kefu.vue')), 'kefu');
const myFavList = r => require.ensure([], () => r(require('./../components/views/myFavList.vue')), 'myFavList');


Vue.use(Router);
export default new Router({
  routes: [
    {
      path: '/index',
      component: index,
      meta:{title:'优一家商城',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/myFavList',
      component: myFavList,
      meta:{title:'我的收藏',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/game',
      component: game,
      meta:{title:'游戏',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/gameExper',
      component: gameExper,
      meta:{title:'体验模式',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/paysuccess',
      component: paysuccess,
      meta:{title:'支付成功',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/kan',
      component: kan,
      meta:{title:'砍价',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/goodsDetail',
      component: goodsDetail,
      meta:{title:'商品详情',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/kanDetail',
      component: kanDetail,
      meta:{title:'商品详情',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/pay',
      component: pay,
      meta:{title:'订单结算',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/payCart',
      component: payCart,
      meta:{title:'订单结算',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/addAddr',
      component: addAddr,
      meta:{title:'新增地址',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/addrList',
      component: addrList,
      meta:{title:'我的地址',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/cart',
      component: cart,
      meta:{title:'我的购物车',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/user',
      component: user,
      meta:{title:'个人中心',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/prizeList',
      component: prizeList,
      meta:{title:'我的奖品',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/orderList',
      component: orderList,
      meta:{title:'我的订单',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/goodsDetailGet',
      component: goodsDetailGet,
      meta:{title:'商品详情',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/jfGoods',
      component: jfGoods,
      meta:{title:'积分可兑换商品',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/orderSuccess',
      component: orderSuccess,
      meta:{title:'下单成功',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/kefu',
      component: kefu,
      meta:{title:'联系客服',showWXMenu:true,backRefresh:false,bodybg:'#f6f6f6'},
      name: '',
      hidden: true
    },
    {
      path: '/404',
      component: NotFound,
      name: '',
      meta:{title:'访问出错',showWXMenu:false},
      hidden: true
    },
    {
      path: '/',
      component: index,
      meta:{title:'首页',bodybg:'#fff'},
      name: '',
      hidden: true
    },
    {
        path: '*',
        meta:{title:'访问出错',showWXMenu:false},
        hidden: true,
        redirect: { path: '/404' }
    }
  ]
})
